import { createApp } from 'vue'
import App from './App.vue'
import mitt from 'mitt'

const app = createApp(App)

// 创建全局事件总线
const bus = mitt()

// 提供和 Vue2 类似的 API，组件里依旧用 this.$bus
app.config.globalProperties.$bus = {
  $on: bus.on,
  $off: bus.off,
  $emit: bus.emit,
}

app.mount('#app')

